package com.jiantong.work.enums;

/**
 * Created by niufei on 2017/3/23.
 *
 */
public enum DocumentsDeleteFlag {
    NORMAL(1,"正常"),
    DELETE(-1,"删除"),;

    private final Integer value;
    private final String description;

    DocumentsDeleteFlag(Integer value, String description) {
        this.value = value;
        this.description = description;
    }

    public static DocumentsDeleteFlag from(Integer value) {
        for (DocumentsDeleteFlag documentsDeleteFlag : DocumentsDeleteFlag.values()) {
            if (documentsDeleteFlag.value == value) {
                return documentsDeleteFlag;
            }
        }
        return null;
    }

    public Integer value() {
        return this.value;
    }

    @Override
    public String toString() {
        return description;
    }
}
